/**
 * 
 */
package com.kelaite.procurement.entity;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

import com.fasterxml.jackson.annotation.JsonIgnore;

/**
 * @author think
 *
 */
@Entity(name = "t_purchase_organization_user")
public class TPurchaseOrganizationUser extends TBaseEntity {
	//
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name = "id")
	private Long id;

	@ManyToOne(cascade = CascadeType.REFRESH, optional = false)
	@JoinColumn(name = "purchase_organization_id")
	@JsonIgnore
	private TPurchaseOrganization tPurchaseOrganization;

	@ManyToOne(cascade = CascadeType.REFRESH, optional = false)
	@JoinColumn(name = "user_id")
	private TUser tUser;

	@Column(name = "status", nullable = false, length = 1)
	private Integer status; // 0：无效 1：有效

	public TPurchaseOrganizationUser() {
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public TPurchaseOrganization gettPurchaseOrganization() {
		return tPurchaseOrganization;
	}

	public void settPurchaseOrganization(
			TPurchaseOrganization tPurchaseOrganization) {
		this.tPurchaseOrganization = tPurchaseOrganization;
	}

	public TUser gettUser() {
		return tUser;
	}

	public void settUser(TUser tUser) {
		this.tUser = tUser;
	}

	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}
}
